Passed
Pull Request — master (#89)
by Mathieu
01:44
created

File   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 41
dl 0
loc 46
rs 10
c 0
b 0
f 0

5 Functions

Rating   Name   Duplication   Size   Complexity  
A getName 0 3 1
A getSize 0 3 1
A getMimeType 0 3 1
A getPassword 0 3 1
A getId 0 3 1
1
import {Entity, Column, PrimaryGeneratedColumn} from 'typeorm';
2
3
@Entity()
4
export class File {
5
  @PrimaryGeneratedColumn('uuid')
6
  private id: string;
7
8
  @Column({type: 'varchar', nullable: false})
9
  private name: string;
10
11
  @Column({type: 'integer', nullable: false})
12
  private size: number;
13
14
  @Column({type: 'varchar', nullable: false})
15
  private mimeType: string;
16
17
  @Column({type: 'varchar', nullable: false})
18
  private password: string;
19
20
  @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'})
21
  private uploadedAt: Date;
22
23
  constructor(name: string, size: number, mimeType: string, password: string) {
24
    this.name = name;
25
    this.size = size;
26
    this.mimeType = mimeType;
27
    this.password = password;
28
  }
29
30
  public getId(): string {
31
    return this.id;
32
  }
33
34
  public getName(): string {
35
    return this.name;
36
  }
37
38
  public getSize(): number {
39
    return this.size;
40
  }
41
42
  public getMimeType(): string {
43
    return this.mimeType;
44
  }
45
46
  public getPassword(): string {
47
    return this.password;
48
  }
49
}
50